import java.util.Scanner;

public class DsmTest {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();

        int temp = 0;

        for (int i = a; i <= b; i++) {
            for (int j = i; j <= b; j++) {
                int tem = i ^ j;
                if (tem > temp) {
                    temp = tem;
                }
            }
        }
        System.out.println(temp);

    }
}
